home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb.new / gdb-3.98 / gdb / gdb.info-4 < prev    next >
Encoding:
Text File  |  1991-08-01  |  45.2 KB  |  1,241 lines

  1. Info file gdb.info, produced by Makeinfo, -*- Text -*- from input
  2. file gdb-all.texinfo.
  3.  
  4.    This file documents the GNU debugger GDB.
  5.  
  6.    Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of
  9. this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.  
  13.    Permission is granted to copy and distribute modified versions of
  14. this
  15. manual under the conditions for verbatim copying, provided also that
  16. the section entitled "GNU General Public License" is included
  17. exactly as in the original, and provided that the entire resulting
  18. derived work is distributed under the terms of a permission notice
  19. identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for
  23. modified versions, except that the section entitled "GNU General
  24. Public License" may be included in a translation approved by the
  25. Free Software Foundation instead of in the original English.
  26.  
  27. 
  28. File: gdb.info,  Node: Files,  Next: Symbol Errors,  Prev: GDB Files,  Up: GDB Files
  29.  
  30. Commands to Specify Files
  31. =========================
  32.  
  33.    GDB needs to know the file name of the program to be debugged,
  34. both in order to read its symbol table and in order to start the
  35. program.  To debug a core dump of a previous run, GDB must be told
  36. the file name of the core dump.
  37.  
  38.    The usual way to specify the executable and core dump file names
  39. is with the command arguments given when you start GDB, as discussed
  40. in *note Invocation::..
  41.  
  42.    Occasionally it is necessary to change to a different file during
  43. a GDB session.  Or you may run GDB and forget to specify the files
  44. you want to use.  In these situations the GDB commands to specify
  45. new files are useful.
  46.  
  47. `file FILENAME'
  48.      Use FILENAME as the program to be debugged.  It is read for its
  49.      symbols and for the contents of pure memory.  It is also the
  50.      program executed when you use the `run' command.  If you do not
  51.      specify a directory and the file is not found in GDB's working
  52.      directory,
  53.  
  54.      GDB uses the environment variable `PATH' as a list of
  55.      directories to search, just as the shell does when looking for
  56.      a
  57.      program to run.  You can change the value of this variable, for
  58.      both GDB and your program, using the `path' command.
  59.  
  60.      `file' with no argument makes GDB discard any information it has
  61.      on both executable file and the symbol table.
  62.  
  63. `exec-file FILENAME'
  64.      Specify that the program to be run (but not the symbol table) is
  65.      found in FILENAME.  GDB will search the environment variable
  66.      `PATH' if necessary to locate the program.
  67.  
  68. `symbol-file FILENAME'
  69.      Read symbol table information from file FILENAME.  `PATH' is
  70.      searched when necessary.  Use the `file' command to get both
  71.      symbol table and program to run from the same file.
  72.  
  73.      `symbol-file' with no argument clears out GDB's information on
  74.      your program's symbol table.
  75.  
  76.      The `symbol-file' command causes GDB to forget the contents of
  77.      its convenience variables, the value history, and all
  78.      breakpoints and auto-display expressions.  This is because they
  79.     
  80.      may contain pointers to the internal data recording symbols and
  81.      data types, which are part of the old symbol table data being
  82.      discarded inside GDB.
  83.  
  84.      `symbol-file' will not repeat if you press RET again after
  85.      executing it once.
  86.  
  87.      On some kinds of object files, the `symbol-file' command does
  88.      not actually read the symbol table in full right away. 
  89.      Instead, it scans the symbol table quickly to find which source
  90.      files and which symbols are present.  The details are read
  91.      later, one source file at a time, when they are needed.
  92.  
  93.      The purpose of this two-stage reading strategy is to make GDB
  94.      start up faster.  For the most part, it is invisible except for
  95.      occasional pauses while the symbol table details for a
  96.      particular source file are being read.  (The `set verbose'
  97.      command can turn these pauses into messages if desired. *Note
  98.      Messages/Warnings::).
  99.  
  100.      When the symbol table is stored in COFF format, `symbol-file'
  101.      does read the symbol table data in full right away.  We haven't
  102.      implemented the two-stage strategy for COFF yet.
  103.  
  104.      When GDB is configured for a particular environment, it will
  105.      understand debugging information in whatever format is the
  106.      standard generated for that environment; you may use either a
  107.      GNU compiler, or other compilers that adhere to the local
  108.      conventions.  Best results are usually obtained from GNU
  109.      compilers; for example, using `gcc' you can generate debugging
  110.      information for optimized code.
  111.  
  112. `core-file FILENAME'
  113. `core FILENAME'
  114.      Specify the whereabouts of a core dump file to be used as the
  115.      "contents of memory".  Traditionally, core files contain only
  116.      some parts of the address space of the process that generated
  117.      them; GDB can access the executable file itself for other parts.
  118.  
  119.      `core-file' with no argument specifies that no core file is to
  120.      be used.
  121.  
  122.      Note that the core file is ignored when your program is actually
  123.      running under GDB.  So, if you have been running the program
  124.      and you wish to debug a core file instead, you must kill the
  125.      subprocess in which the program is running.  To do this, use
  126.      the `kill' command (*note Kill Process::.).
  127.  
  128. `load FILENAME'
  129.      Depending on what remote debugging facilities are configured
  130.      into GDB, the `load' command may be available.  Where it
  131.      exists, it is meant to make FILENAME (an executable) available
  132.      for debugging on the remote system--by downloading, or dynamic
  133.      linking, for example.  `load' also records FILENAME's symbol
  134.      table in GDB, like the `add-symbol-file' command.
  135.  
  136.      If `load' is not available on your GDB, attempting to execute it
  137.      gets the error message "`You can't do that when your target is
  138.      ...'"
  139.  
  140.      On VxWorks, `load' will dynamically link FILENAME on the current
  141.      target system as well as adding its symbols in GDB.
  142.  
  143.      With the Nindy interface to an Intel 960 board, `load' will
  144.      download FILENAME to the 960 as well as adding its symbols in
  145.      GDB.
  146.  
  147.      `load' will not repeat if you press RET again after using it.
  148.  
  149. `add-symbol-file FILENAME ADDRESS'
  150.      The `add-symbol-file' command reads additional symbol table
  151.      information from the file FILENAME.  You would use this command
  152.      when that file has been dynamically loaded (by some other
  153.      means) into the program that is running.  ADDRESS should be the
  154.      memory address at which the file has been loaded; GDB cannot
  155.      figure this out for itself.
  156.  
  157.      The symbol table of the file FILENAME is added to the symbol
  158.      table originally read with the `symbol-file' command.  You can
  159.      use the `add-symbol-file' command any number of times; the new
  160.      symbol data thus read keeps adding to the old.  To discard all
  161.      old symbol data instead, use the `symbol-file' command.
  162.  
  163.      `add-symbol-file' will not repeat if you press RET after using it.
  164.  
  165. `info files'
  166. `info target'
  167.      `info files' and `info target' are synonymous; both print the
  168.      current targets (*note Targets::.), including the names of the
  169.      executable and core dump files currently in use by GDB, and the
  170.      files from which symbols were loaded.  The command `help
  171.      targets' lists all possible targets rather than current ones.
  172.  
  173.    All file-specifying commands allow both absolute and relative file
  174. names as arguments.  GDB always converts the file name to an
  175. absolute path name and remembers it that way.
  176.  
  177.    GDB supports the SunOS shared library format.  Symbols from a
  178. shared library cannot be referenced before the shared library has
  179. been linked with the program.  (That is to say, until after you type
  180. `run' and  the function `main' has been entered; or when examining
  181. core files.)  Once the shared library has been linked in, you can
  182. use the following commands:
  183.  
  184. `sharedlibrary REGEX'
  185. `share REGEX'
  186.      Load shared object library symbols for files matching a UNIX
  187.      regular expression.
  188.  
  189. `share'
  190. `sharedlibrary'
  191.      Load symbols for all shared libraries.
  192.  
  193. `info share'
  194. `info sharedlibrary'
  195.      Print the names of the shared libraries which you have loaded
  196.      with the `sharedlibrary' command.
  197.  
  198.    `sharedlibrary' does not repeat automatically when you press RET
  199. after using it once.
  200.  
  201. 
  202. File: gdb.info,  Node: Symbol Errors,  Prev: Files,  Up: GDB Files
  203.  
  204. Errors Reading Symbol Files
  205. ===========================
  206.  
  207.    While a symbol file is being read, GDB will occasionally encounter
  208. problems, such as symbol types it does not recognize, or known bugs
  209. in compiler output.  By default, it prints one message about each
  210. such type of problem, no matter how many times the problem occurs. 
  211. You can ask it to print more messages, to see how many times the
  212. problems occur, or can shut the messages off entirely, with the `set
  213. complaints' command (*Note Messages/Warnings::).
  214.  
  215.    The messages currently printed, and their meanings, are:
  216.  
  217. `inner block not inside outer block in SYMBOL'
  218.      The symbol information shows where symbol scopes begin and end
  219.      (such as at the start of a function or a block of statements). 
  220.      This error indicates that an inner scope block is not fully
  221.      contained in its outer scope blocks.
  222.  
  223.      GDB circumvents the problem by treating the inner block as if it
  224.      had the same scope as the outer block.  In the error message,
  225.      SYMBOL may be shown as "`(don't know)'" if the outer block is
  226.      not a function.
  227.  
  228. `block at ADDRESS out of order'
  229.      The symbol information for symbol scope blocks should occur in 
  230.      order of increasing addresses.  This error indicates that it
  231.      does not do so.
  232.  
  233.      GDB does not circumvent this problem, and will have trouble
  234.      locating symbols in the source file whose symbols being read. 
  235.      (You can often determine what source file is affected by
  236.      specifying `set verbose on'.  *Note Messages/Warnings::.)
  237.  
  238. `bad block start address patched'
  239.      The symbol information for a symbol scope block has a start
  240.      address smaller than the address of the preceding source line. 
  241.      This is known to occur in the SunOS 4.1.1 (and earlier) C
  242.      compiler.
  243.  
  244.      GDB circumvents the problem by treating the symbol scope block
  245.      as starting on the previous source line.
  246.  
  247. `bad string table offset in symbol N'
  248.      Symbol number N contains a pointer into the string table which
  249.      is larger than the size of the string table.
  250.  
  251.      GDB circumvents the problem by considering the symbol to have
  252.      the name `foo', which may cause other problems if many symbols
  253.      end up with this name.
  254.  
  255. `unknown symbol type `0xNN''
  256.      The symbol information contains new data types that GDB does not
  257.      yet know how to read.  `0xNN' is the symbol type of the
  258.      misunderstood information, in hexadecimal.
  259.  
  260.      GDB circumvents the error by ignoring this symbol information. 
  261.      This will usually allow the program to be debugged, though
  262.      certain symbols will not be accessible.  If you encounter such
  263.      a problem and feel like debugging it, you can debug `gdb' with
  264.      itself, breakpoint on `complain', then go up to the function
  265.      `read_dbx_symtab' and examine `*bufp' to see the symbol.
  266.  
  267. `stub type has NULL name'
  268.      GDB could not find the full definition for a struct or class.
  269.  
  270. `C++ type mismatch between compiler and debugger'
  271.      GDB could not parse a type specification output by the compiler
  272.      for some C++ object.
  273.  
  274. 
  275. File: gdb.info,  Node: Targets,  Next: Controlling GDB,  Prev: GDB Files,  Up: Top
  276.  
  277. Specifying a Debugging Target
  278. *****************************
  279.  
  280.    A "target" is an interface between the debugger and a particular 
  281. kind of file or process.
  282.  
  283.    Often, you will be able to run GDB in the same host environment as
  284. the program you are debugging; in that case, the debugging target
  285. can just be specified as a side effect of the `file' or `core'
  286. commands.  When you need more flexibility--for example, running GDB
  287. on a physically separate host, controlling standalone systems over a
  288. serial port, or realtime systems over a TCP/IP connection--you can
  289. use the `target' command.
  290.  
  291. * Menu:
  292.  
  293. * Active Targets::        Active Targets
  294. * Target Commands::        Commands for Managing Targets
  295. * Remote::            Remote Debugging
  296.  
  297. 
  298. File: gdb.info,  Node: Active Targets,  Next: Target Commands,  Prev: Targets,  Up: Targets
  299.  
  300. Active Targets
  301. ==============
  302.  
  303.    Targets are managed in three "strata" that correspond to different
  304. classes of target: processes, core files, and executable files. 
  305. This allows you to (for example) start a process and inspect its
  306. activity without abandoning your work on a core file.
  307.  
  308.    More than one target can potentially respond to a request.  In
  309. particular, when you access memory GDB will examine the three strata
  310. of targets until it finds a target that can handle that particular
  311. address.  Strata are always examined in a fixed order: first a
  312. process if there is one, then a core file if there is one, and
  313. finally
  314. an executable file if there is one of those.
  315.  
  316.    When you specify a new target in a given stratum, it replaces any
  317. target previously in that stratum.
  318.  
  319.    To get rid of a target without replacing it, use the `detach'
  320. command.  The related command `attach' provides you with a way of
  321. choosing a particular running process as a new target. *Note Attach::.
  322.  
  323. 
  324. File: gdb.info,  Node: Target Commands,  Next: Remote,  Prev: Active Targets,  Up: Targets
  325.  
  326. Commands for Managing Targets
  327. =============================
  328.  
  329. `target TYPE PARAMETERS'
  330.      Connects the GDB host environment to a target machine or
  331.      process.  A target is typically a protocol for talking to
  332.      debugging facilities.  You use the argument TYPE to specify the
  333.      type or protocol of the target machine.
  334.  
  335.      Further PARAMETERS are interpreted by the target protocol, but
  336.      typically include things like device names or host names to
  337.      connect with, process numbers, and baud rates.
  338.  
  339.      The `target' command will not repeat if you press RET again
  340.      after executing the command.
  341.  
  342. `help target'
  343.      Displays the names of all targets available.  To display targets
  344.      currently selected, use either `info target' or `info files'
  345.      (*note Files::.).
  346.  
  347. `help target NAME'
  348.      Describe a particular target, including any parameters necessary
  349.      to select it.
  350.  
  351.    Here are some common targets (available, or not, depending on the
  352. GDB configuration):
  353.  
  354. `target exec PROG'
  355.      An executable file.  `target exec PROG' is the same as
  356.      `exec-file PROG'.
  357.  
  358. `target core FILENAME'
  359.      A core dump file.  `target core FILENAME' is the same as
  360.      `core-file FILENAME'.
  361.  
  362. `target remote DEV'
  363.      Remote serial target in GDB-specific protocol.  The argument DEV
  364.      specifies what serial device to use for the connection (e.g. 
  365.      `/dev/ttya'). *Note Remote::.
  366.  
  367. `target amd-eb DEV SPEED PROG'
  368.      Remote PC-resident AMD EB29K board, attached over serial lines. 
  369.      DEV is the serial device, as for `target remote'; SPEED allows
  370.      you to specify the linespeed; and PROG is the name of the
  371.      program to be debugged, as it appears to DOS on the PC.  *Note
  372.      EB29K Remote::.
  373.  
  374. `target nindy DEVICENAME'
  375.      An Intel 960 board controlled by a Nindy Monitor.  DEVICENAME is
  376.      the name of the serial device to use for the connection, e.g. 
  377.      `/dev/ttya'.  *Note i960-Nindy Remote::.
  378.  
  379. `target vxworks MACHINENAME'
  380.      A VxWorks system, attached via TCP/IP.  The argument MACHINENAME
  381.      is the target system's machine name or IP address.  *Note
  382.      VxWorks Remote::.
  383.  
  384.    Different targets are available on different configurations of
  385. GDB; your configuration may have more or fewer targets.
  386.  
  387. 
  388. File: gdb.info,  Node: Remote,  Prev: Target Commands,  Up: Targets
  389.  
  390. Remote Debugging
  391. ================
  392.  
  393. * Menu:
  394.  
  395. * i960-Nindy Remote::        
  396. * EB29K Remote::        
  397. * VxWorks Remote::        
  398.  
  399.    If you are trying to debug a program running on a machine that
  400. can't run GDB in the usual way, it is often useful to use remote
  401. debugging.  For example, you might use remote debugging on an
  402. operating system kernel, or on a small system which does not have a
  403. general purpose operating system powerful enough to run a
  404. full-featured debugger.
  405.  
  406.    Some configurations of GDB have special serial or TCP/IP
  407. interfaces to make this work with particular debugging targets.  In
  408. addition,
  409. GDB comes with a generic serial protocol (specific to GDB, but not
  410. specific to any particular target system) which you can use if you
  411. write the remote stubs--the code that will run on the remote system
  412. to
  413. communicate
  414. with GDB.
  415.  
  416.    To use the GDB remote serial protocol, the program to be debugged
  417. on the remote machine needs to contain a debugging stub which talks
  418. to GDB over the serial line.  Several working remote stubs are
  419. distributed with GDB; see the `README' file in the GDB distribution
  420. for more information.
  421.  
  422.    For details of this communication protocol, see the comments in
  423. the GDB source file `remote.c'.
  424.  
  425.    To start remote debugging, first run GDB and specify as an
  426. executable file the program that is running in the remote machine. 
  427. This tells GDB how to find the program's symbols and the contents of
  428. its pure text.  Then establish communication using the `target
  429. remote' command with a device name as an argument.  For example:
  430.  
  431.      target remote /dev/ttyb
  432.  
  433. if the serial line is connected to the device named `/dev/ttyb'. 
  434. This will stop the remote machine if it is not already stopped.
  435.  
  436.    Now you can use all the usual commands to examine and change data
  437. and to step and continue the remote program.
  438.  
  439.    To resume the remote program and stop debugging it, use the
  440. `detach' command.
  441.  
  442.    Other remote targets may be available in your configuration of
  443. GDB; use `help targets' to list them.
  444.  
  445. 
  446. File: gdb.info,  Node: i960-Nindy Remote,  Next: EB29K Remote,  Prev: Remote,  Up: Remote
  447.  
  448. GDB with a Remote i960 (Nindy)
  449. ------------------------------
  450.  
  451.    "Nindy" is a ROM Monitor program for Intel 960 target systems. 
  452. When GDB is configured to control a remote Intel 960 using Nindy,
  453. you can tell GDB how to connect to the 960 in several ways:
  454.  
  455.    * Through command line options specifying serial port, version of
  456.      the Nindy protocol, and communications speed;
  457.  
  458.    * By responding to a prompt on startup;
  459.  
  460.    * By using the `target' command at any point during your GDB
  461.      session.  *Note Target Commands::.
  462.  
  463. * Menu:
  464.  
  465. * Nindy Startup::        Startup with Nindy
  466. * Nindy Options::        Options for Nindy
  467. * Nindy reset::            Nindy Reset Command
  468.  
  469. 
  470. File: gdb.info,  Node: Nindy Startup,  Next: Nindy Options,  Prev: i960-Nindy Remote,  Up: i960-Nindy Remote
  471.  
  472. Startup with Nindy
  473. ..................
  474.  
  475.    If you simply start `GDB' without using any command-line options,
  476. you are prompted for what serial port to use, *before* you reach the
  477. ordinary GDB prompt:
  478.  
  479.      Attach /dev/ttyNN -- specify NN, or "quit" to quit:
  480.  
  481. Respond to the prompt with whatever suffix (after `/dev/tty')
  482. identifies the serial port you want to use.  You can, if you choose,
  483. simply start up with no Nindy connection by responding to the prompt
  484. with an empty line.  If you do this, and later wish to attach to
  485. Nindy, use `target' (*note Target Commands::.).
  486.  
  487. 
  488. File: gdb.info,  Node: Nindy Options,  Next: Nindy reset,  Prev: Nindy Startup,  Up: i960-Nindy Remote
  489.  
  490. Options for Nindy
  491. .................
  492.  
  493.    These are the startup options for beginning your GDB session with
  494. a Nindy-960 board attached:
  495.  
  496. `-r PORT'
  497.      Specify the serial port name of a serial interface to be used to
  498.      connect to the target system.  This option is only available
  499.      when GDB is configured for the Intel 960 target architecture. 
  500.      You may specify PORT as any of: a full pathname (e.g. `-r
  501.      /dev/ttya'), a device name in `/dev' (e.g. `-r ttya'), or
  502.      simply
  503.      the unique suffix for a specific `tty' (e.g. `-r a').
  504.  
  505. `-O'
  506.      (An uppercase letter "O", not a zero.)  Specify that GDB should
  507.      use the "old" Nindy monitor protocol to connect to the target
  508.      system.  This option is only available when GDB is configured
  509.      for the Intel 960 target architecture.
  510.  
  511.           *Warning:* if you specify `-O', but are actually trying to
  512.           connect to a target system that expects the newer
  513.           protocol, the connection will fail, appearing to be a
  514.           speed mismatch.  GDB will repeatedly attempt to reconnect
  515.           at several different line speeds.  You can abort this
  516.          
  517.           process with an interrupt.
  518.  
  519. `-brk'
  520.      Specify that GDB should first send a `BREAK' signal to the
  521.      target system, in an attempt to reset it, before connecting to
  522.      a Nindy target.
  523.  
  524.           *Warning:* Many target systems do not have the hardware
  525.           that this requires; it only works with a few boards.
  526.  
  527.    The standard `-b' option controls the line speed used on the
  528. serial port.
  529.  
  530. 
  531. File: gdb.info,  Node: Nindy reset,  Prev: Nindy Options,  Up: i960-Nindy Remote
  532.  
  533. Nindy Reset Command
  534. ...................
  535.  
  536. `reset'
  537.      For a Nindy target, this command sends a "break" to the remote
  538.      target system; this is only useful if the target has been
  539.      equipped with a circuit to perform a hard reset (or some other
  540.      interesting action) when a break is detected.
  541.  
  542. 
  543. File: gdb.info,  Node: EB29K Remote,  Next: VxWorks Remote,  Prev: i960-Nindy Remote,  Up: Remote
  544.  
  545. GDB with a Remote EB29K
  546. -----------------------
  547.  
  548.    To use GDB from a Unix system to run programs on AMD's EB29K board
  549. in a PC, you must first connect a serial cable between the PC and a
  550. serial port on the Unix system.  In the following, we assume you've
  551. hooked the cable between the PC's `COM1' port and `/dev/ttya' on the
  552. Unix system.
  553.  
  554. * Menu:
  555.  
  556. * Comms (EB29K)::        Communications Setup
  557. * gdb-EB29K::            EB29K cross-debugging
  558. * Remote Log::            Remote Log
  559.  
  560. 
  561. File: gdb.info,  Node: Comms (EB29K),  Next: gdb-EB29K,  Prev: EB29K Remote,  Up: EB29K Remote
  562.  
  563. Communications Setup
  564. ....................
  565.  
  566.    The next step is to set up the PC's port, by doing something like
  567. the following in DOS on the PC:
  568.  
  569.      C:\> MODE com1:9600,n,8,1,none
  570.  
  571. This example--run on an MS DOS 4.0 system--sets the PC port to 9600
  572. bps, no parity, eight data bits, one stop bit, and no "retry"
  573. action; you must match the communications parameters when
  574. establishing the Unix end of the connection as well.
  575.  
  576.    To give control of the PC to the Unix side of the serial line,
  577. type the following at the DOS console:
  578.  
  579.      C:\> CTTY com1
  580.  
  581. (Later, if you wish to return control to the DOS console, you can use
  582. the command `CTTY con'--but you must send it over the device that
  583. had control, in our example over the `COM1' serial line).
  584.  
  585.    From the Unix host, use a communications program such as `tip' or
  586. `cu' to communicate with the PC; for example,
  587.  
  588.      cu -s 9600 -l /dev/ttya
  589.  
  590. The `cu' options shown specify, respectively, the linespeed and the
  591. serial port to use.  If you use `tip' instead, your command line may
  592. look something like the following:
  593.  
  594.      tip -9600 /dev/ttya
  595.  
  596. Your system may define a different name where our example uses
  597. `/dev/ttya' as the argument to `tip'.  The communications
  598. parameters, including what port to use, are associated with the
  599. `tip' argument in the "remote" descriptions file--normally the
  600. system table `/etc/remote'.
  601.  
  602.    Using the `tip' or `cu' connection, change the DOS working
  603. directory to the directory containing a copy of your 29K program,
  604. then start the PC program `EBMON' (an EB29K control program supplied
  605. with your board by AMD).  You should see an initial display from
  606. `EBMON' similar to the one that follows, ending with the `EBMON'
  607. prompt `#'--
  608.  
  609.      C:\> G:
  610.      
  611.      G:\> CD \usr\joe\work29k
  612.      
  613.      G:\USR\JOE\WORK29K> EBMON
  614.      Am29000 PC Coprocessor Board Monitor, version 3.0-18
  615.      Copyright 1990 Advanced Micro Devices, Inc.
  616.      Written by Gibbons and Associates, Inc.
  617.      
  618.      Enter '?' or 'H' for help
  619.      
  620.      PC Coprocessor Type   = EB29K
  621.      I/O Base              = 0x208
  622.      Memory Base           = 0xd0000
  623.      
  624.      Data Memory Size      = 2048KB
  625.      Available I-RAM Range = 0x8000 to 0x1fffff
  626.      Available D-RAM Range = 0x80002000 to 0x801fffff
  627.      
  628.      PageSize              = 0x400
  629.      Register Stack Size   = 0x800
  630.      Memory Stack Size     = 0x1800
  631.      
  632.      CPU PRL               = 0x3
  633.      Am29027 Available     = No
  634.      Byte Write Available  = Yes
  635.      
  636.      # ~.
  637.  
  638.    Then exit the `cu' or `tip' program (done in the example by typing
  639. `~.' at the `EBMON' prompt).  `EBMON' will keep running, ready for
  640. GDB to take over.
  641.  
  642.    For this example, we've assumed what is probably the most
  643. convenient way to make sure the same 29K program is on both the PC
  644. and the Unix system: a PC/NFS connection that establishes "drive
  645. `G:'" on the PC as a file system on the Unix host.  If you don't
  646. have PC/NFS or something similar connecting the two systems, you
  647. must arrange some other way--perhaps floppy-disk transfer--of
  648. getting
  649. the 29K program from the Unix system to the PC; GDB will *not*
  650. download it over the serial line.
  651.  
  652. 
  653. File: gdb.info,  Node: gdb-EB29K,  Next: Remote Log,  Prev: Comms (EB29K),  Up: EB29K Remote
  654.  
  655. EB29K cross-debugging
  656. .....................
  657.  
  658.    Finally, `cd' to the directory containing an image of your 29K
  659. program on the Unix system, and start GDB--specifying as argument
  660. the name of your 29K program:
  661.  
  662.      cd /usr/joe/work29k
  663.      gdb myfoo
  664.  
  665.    Now you can use the `target' command:
  666.  
  667.      target amd-eb /dev/ttya 9600 MYFOO
  668.  
  669. In this example, we've assumed your program is in a file called
  670. `myfoo'.  Note that the filename given as the last argument to
  671. `target amd-eb' should be the name of the program as it appears to
  672. DOS.  In our example this is simply `MYFOO', but in general it can
  673. include a DOS path, and depending on your transfer mechanism may not
  674. resemble the name on the Unix side.
  675.  
  676.    At this point, you can set any breakpoints you wish; when you're
  677. ready to see your program run on the 29K board, use the GDB command
  678. `run'.
  679.  
  680.    To stop debugging the remote program, use the GDB `detach'
  681. command.
  682.  
  683.    To return control of the PC to its console, use `tip' or `cu' once
  684. again,
  685. after your GDB session has concluded, to attach to `EBMON'.  You can
  686. then type the command `q' to shut down `EBMON', returning control to
  687. the DOS command-line interpreter.  Type `CTTY con' to return command
  688. input to the main DOS console, and type `~.' to leave `tip' or `cu'.
  689.  
  690. 
  691. File: gdb.info,  Node: Remote Log,  Prev: gdb-EB29K,  Up: EB29K Remote
  692.  
  693. Remote Log
  694. ..........
  695.  
  696.    The `target amd-eb' command creates a file `eb.log' in the current
  697. working directory, to help debug problems with the connection. 
  698. `eb.log' records all the output from `EBMON', including echoes of
  699. the commands sent to it.  Running `tail -f' on this file in another
  700. window often helps to understand trouble with `EBMON', or unexpected
  701. events on the PC side of the connection.
  702.  
  703. 
  704. File: gdb.info,  Node: VxWorks Remote,  Prev: EB29K Remote,  Up: Remote
  705.  
  706. GDB and VxWorks
  707. ---------------
  708.  
  709.    GDB enables developers to spawn and debug tasks running on
  710. networked VxWorks targets from a Unix host.  Already-running tasks
  711. spawned from the VxWorks shell can also be debugged.  GDB uses code
  712. that
  713. runs on both the UNIX host and on the VxWorks target.  The program
  714. `gdb' is installed and executed on the UNIX host.
  715.  
  716.    The remote debugging interface (RDB) routines are installed and
  717. executed on the VxWorks target.  These routines are included in the
  718. VxWorks library `rdb.a' and are incorporated into the system image
  719. when source-level debugging is enabled in the VxWorks configuration.
  720.  
  721.    Defining `INCLUDE_RDB' in the VxWorks configuration file
  722. `configAll.h' includes the RDB interface routines and spawns the
  723. source debugging task `tRdbTask' when VxWorks is booted.  For more
  724. information on configuring and remaking VxWorks, see the `VxWorks
  725. Programmer's Guide'.
  726.  
  727.    Once you have included the RDB interface in your VxWorks system
  728. image and set your Unix execution search path to find GDB, you are
  729. ready to run GDB.  From your UNIX host, type:
  730.  
  731.      % gdb
  732.  
  733.    GDB will come up showing the prompt:
  734.  
  735.      (gdb)
  736.  
  737. * Menu:
  738.  
  739. * VxWorks connection::        Connecting to VxWorks
  740. * VxWorks download::        VxWorks Download
  741. * VxWorks attach::        Running Tasks
  742.  
  743. 
  744. File: gdb.info,  Node: VxWorks connection,  Next: VxWorks download,  Prev: VxWorks Remote,  Up: VxWorks Remote
  745.  
  746. Connecting to VxWorks
  747. .....................
  748.  
  749.    The GDB command `target' lets you connect to a VxWorks target on
  750. the network.  To connect to a target whose host name is "`tt'", type:
  751.  
  752.      (gdb) target vxworks tt
  753.  
  754.    GDB will display a message similar to the following:
  755.  
  756.      Attaching remote machine across net... Success!
  757.  
  758.    GDB will then attempt to read the symbol tables of any object
  759. modules loaded into the VxWorks target since it was last booted. 
  760. GDB locates these files by searching the directories listed in the
  761. command search path (*note Environment::.); if it fails to find an
  762. object file, it will display a message such as:
  763.  
  764.      prog.o: No such file or directory.
  765.  
  766.    This will cause the `target' command to abort.  When this happens,
  767. you should add the appropriate directory to the search path, with
  768. the GDB command `path', and execute the `target' command again.
  769.  
  770. 
  771. File: gdb.info,  Node: VxWorks download,  Next: VxWorks attach,  Prev: VxWorks connection,  Up: VxWorks Remote
  772.  
  773. VxWorks Download
  774. ................
  775.  
  776.    If you have connected to the VxWorks target and you want to debug
  777. an object that has not yet been loaded, you can use the GDB `load'
  778. command to download a file from UNIX to VxWorks incrementally.  The
  779. object file given as an argument to the `load' command is actually
  780. opened twice: first by the VxWorks target in order to download the
  781. code, then by GDB in order to read the symbol table.  This can lead
  782. to problems if the current working directories on the two systems
  783. differ.  It is simplest to set the working directory on both systems
  784. to the directory in which the object file resides, and then to
  785. reference the file by its name, without any path.  Thus, to load a
  786. program `prog.o', residing in `wherever/vw/demo/rdb', on VxWorks type:
  787.  
  788.      -> cd "wherever/vw/demo/rdb"
  789.  
  790.    On GDB type:
  791.  
  792.      (gdb) cd wherever/vw/demo/rdb 
  793.      (gdb) load prog.o
  794.  
  795.    GDB will display a response similar to the following:
  796.  
  797.      Reading symbol data from wherever/vw/demo/rdb/prog.o... done.
  798.  
  799.    You can also use the `load' command to reload an object module
  800. after
  801. editing and recompiling the corresponding source file.  Note that
  802. this will cause GDB to delete all currently-defined breakpoints,
  803. auto-displays, and convenience variables, and to clear the value
  804. history.  (This is necessary in order to preserve the integrity of
  805. debugger data structures that reference the target system's symbol
  806. table.)
  807.  
  808. 
  809. File: gdb.info,  Node: VxWorks attach,  Prev: VxWorks download,  Up: VxWorks Remote
  810.  
  811. Running Tasks
  812. .............
  813.  
  814.    You can also attach to an existing task using the `attach' command
  815. as follows:
  816.  
  817.      (gdb) attach TASK
  818.  
  819.    where TASK is the VxWorks hexadecimal task ID.  The task can be
  820. running or suspended when you attach to it.  If running, it will be
  821. suspended
  822. at the time of attachment.
  823.  
  824. 
  825. File: gdb.info,  Node: Controlling GDB,  Next: Sequences,  Prev: Targets,  Up: Top
  826.  
  827. Controlling GDB
  828. ***************
  829.  
  830.    You can alter many aspects of GDB's interaction with you by using
  831. the `set' command.  For commands controlling how GDB displays data,
  832. *note Print Settings::.; other settings are described here.
  833.  
  834. * Menu:
  835.  
  836. * Prompt::            Prompt
  837. * Editing::            Command Editing
  838. * History::            Command History
  839. * Screen Size::            Screen Size
  840. * Numbers::            Numbers
  841. * Messages/Warnings::        Optional Warnings and Messages
  842.  
  843. 
  844. File: gdb.info,  Node: Prompt,  Next: Editing,  Prev: Controlling GDB,  Up: Controlling GDB
  845.  
  846. Prompt
  847. ======
  848.  
  849.    GDB indicates its readiness to read a command by printing a string
  850. called the "prompt".  This string is normally `(gdb)'.  You can
  851. change
  852. the prompt string with the `set prompt' command.  For instance, when
  853. debugging GDB with GDB, it is useful to change the prompt in one of
  854. the GDBs so that you can always tell which one you are talking to.
  855.  
  856. `set prompt NEWPROMPT'
  857.      Directs GDB to use NEWPROMPT as its prompt string henceforth.
  858.  
  859. `show prompt'
  860.      Prints a line of the form: `Gdb's prompt is: YOUR-PROMPT'
  861.  
  862. 
  863. File: gdb.info,  Node: Editing,  Next: History,  Prev: Prompt,  Up: Controlling GDB
  864.  
  865. Command Editing
  866. ===============
  867.  
  868.    GDB reads its input commands via the "readline" interface.  This
  869. GNU library provides consistent behavior for programs which provide
  870. a command line interface to the user.  Advantages are `emacs'-style
  871. or `vi'-style inline editing of commands, `csh'-like history
  872. substitution, and a storage and recall of command history across
  873. debugging sessions.
  874.  
  875.    You may control the behavior of command line editing in GDB with
  876. the command `set'.
  877.  
  878. `set editing'
  879. `set editing on'
  880.      Enable command line editing (enabled by default).
  881.  
  882. `set editing off'
  883.      Disable command line editing.
  884.  
  885. `show editing'
  886.      Show whether command line editing is enabled.
  887.  
  888. 
  889. File: gdb.info,  Node: History,  Next: Screen Size,  Prev: Editing,  Up: Controlling GDB
  890.  
  891. Command History
  892. ===============
  893.  
  894. `set history filename FNAME'
  895.      Set the name of the GDB command history file to FNAME.  This is
  896.      the file from which GDB will read an initial command history
  897.      list or to which it will write this list when it exits.  This
  898.      list is accessed through history expansion or through the
  899.      history command editing characters listed below.  This file
  900.      defaults to the value of the environment variable
  901.      `GDBHISTFILE', or to `./.gdb_history' if this variable is not
  902.      set.
  903.  
  904. `set history save'
  905. `set history save on'
  906.      Record command history in a file, whose name may be specified
  907.      with the `set history filename' command.  By default, this
  908.      option is disabled.
  909.  
  910. `set history save off'
  911.      Stop recording command history in a file.
  912.  
  913. `set history size SIZE'
  914.      Set the number of commands which GDB will keep in its history
  915.      list.  This defaults to the value of the environment variable
  916.      `HISTSIZE', or to 256 if this variable is not set.
  917.  
  918.    History expansion assigns special meaning to the character `!'. 
  919. Since `!' is also the logical not operator in C, history expansion
  920. is off by default. If you decide to enable history expansion with
  921. the `set history expansion on' command, you may sometimes need to
  922. follow `!' (when it is used as logical not, in an expression) with a
  923. space or a tab to prevent it from being expanded.  The readline
  924. history facilities will not attempt substitution on the strings `!='
  925. and `!(', even when history expansion is enabled.
  926.  
  927.    The commands to control history expansion are:
  928.  
  929. `set history expansion on'
  930. `set history expansion'
  931.      Enable history expansion.  History expansion is off by default.
  932.  
  933. `set history expansion off'
  934.      Disable history expansion.
  935.  
  936.      The readline code comes with more complete documentation of
  937.      editing and history expansion features.  Users unfamiliar with
  938.      `emacs' or `vi' may wish to read it.
  939.  
  940. `show history'
  941. `show history filename'
  942. `show history save'
  943. `show history size'
  944. `show history expansion'
  945.      These commands display the state of the GDB history parameters. 
  946.      `show history' by itself displays all four states.
  947.  
  948. `show commands'
  949.      Display the last ten commands in the command history.
  950.  
  951. `show commands N'
  952.      Print ten commands centered on command number N.
  953.  
  954. `show commands +'
  955.      Print ten commands just after the commands last printed.
  956.  
  957. 
  958. File: gdb.info,  Node: Screen Size,  Next: Numbers,  Prev: History,  Up: Controlling GDB
  959.  
  960. Screen Size
  961. ===========
  962.  
  963.    Certain commands to GDB may produce large amounts of information
  964. output to the screen.  To help you read all of it, GDB pauses and
  965. asks you for input at the end of each page of output.  Type RET when
  966. you want to continue the output.  GDB also uses the screen width
  967. setting to determine when to wrap lines of output.  Depending on
  968. what is being printed, it tries to break the line at a readable
  969. place, rather than simply letting it overflow onto the following line.
  970.  
  971.    Normally GDB knows the size of the screen from the termcap data
  972. base together with the value of the `TERM' environment variable and
  973. the `stty rows' and `stty cols' settings. If this is not correct,
  974. you can override it with the `set height' and `set width' commands:
  975.  
  976. `set height LPP'
  977. `show height'
  978. `set width CPL'
  979. `show width'
  980.      These `set' commands specify a screen height of LPP lines and a
  981.      screen width of CPL characters.  The associated `show' commands
  982.      display the current settings.
  983.  
  984.      If you specify a height of zero lines, GDB will not pause during
  985.      output no matter how long the output is.  This is useful if
  986.      output is to a file or to an editor buffer.
  987.  
  988. 
  989. File: gdb.info,  Node: Numbers,  Next: Messages/Warnings,  Prev: Screen Size,  Up: Controlling GDB
  990.  
  991. Numbers
  992. =======
  993.  
  994.    You can always enter numbers in octal, decimal, or hexadecimal in
  995. GDB by the usual conventions: octal numbers begin with `0', decimal
  996. numbers end with `.', and hexadecimal numbers begin with `0x'. 
  997. Numbers that begin with none of these are, by default, entered in
  998. base 10; likewise, the default display for numbers--when no
  999. particular format is specified--is base 10.  You can change the
  1000. default base for both input and output with the `set radix' command.
  1001.  
  1002. `set radix BASE'
  1003.      Set the default base for numeric input and display.  Supported
  1004.      choices for BASE are decimal 8, 10, 16.  BASE must itself be
  1005.      specified either unambiguously or using the current default
  1006.      radix; for example, any of
  1007.  
  1008.           set radix 012
  1009.           set radix 10.
  1010.           set radix 0xa
  1011.  
  1012.      will set the base to decimal.  On the other hand, `set radix 10'
  1013.     
  1014.      will leave the radix unchanged no matter what it was.
  1015.  
  1016. `show radix'
  1017.      Display the current default base for numeric input and display.
  1018.  
  1019. 
  1020. File: gdb.info,  Node: Messages/Warnings,  Prev: Numbers,  Up: Controlling GDB
  1021.  
  1022. Optional Warnings and Messages
  1023. ==============================
  1024.  
  1025.    By default, GDB is silent about its inner workings.  If you are
  1026. running on a slow machine, you may want to use the `set verbose'
  1027. command.  It will make GDB tell you when it does a lengthy internal
  1028. operation, so you won't think it has crashed.
  1029.  
  1030.    Currently, the messages controlled by `set verbose' are those
  1031. which announce that the symbol table for a source file is being read
  1032. (*note Files::., in the description of the command `symbol-file').
  1033.  
  1034. `set verbose on'
  1035.      Enables GDB's output of certain informational messages.
  1036.  
  1037. `set verbose off'
  1038.      Disables GDB's output of certain informational messages.
  1039.  
  1040. `show verbose'
  1041.      Displays whether `set verbose' is on or off.
  1042.  
  1043.    By default, if GDB encounters bugs in the symbol table of an
  1044. object file, it prints a single message about each type of problem
  1045. it finds, then  shuts up (*note Symbol Errors::.).  You can suppress
  1046. these
  1047. messages, or allow more than one such message to be printed if you
  1048. want to see how frequent the problems are.
  1049.  
  1050. `set complaints LIMIT'
  1051.      Permits GDB to output LIMIT complaints about each type of
  1052.      unusual symbols before becoming silent about the problem.  Set
  1053.      LIMIT to zero to suppress all complaints; set it to a large
  1054.      number to prevent complaints from being suppressed.
  1055.  
  1056. `show complaints'
  1057.      Displays how many symbol complaints GDB is permitted to produce.
  1058.  
  1059.    By default, GDB is cautious, and asks what sometimes seem to be a
  1060. lot of stupid questions to confirm certain commands.  For example,
  1061. if you try to run a program which is already running:
  1062.  
  1063.      (gdb) run
  1064.      The program being debugged has been started already.
  1065.      Start it from the beginning? (y or n)
  1066.  
  1067.    If you're willing to unflinchingly face the consequences of your
  1068. own
  1069. commands, you can disable this "feature":
  1070.  
  1071. `set confirm off'
  1072.      Disables confirmation requests.
  1073.  
  1074. `set confirm on'
  1075.      Enables confirmation requests (the default).
  1076.  
  1077. `show confirm'
  1078.      Displays state of confirmation requests.
  1079.  
  1080. 
  1081. File: gdb.info,  Node: Sequences,  Next: Emacs,  Prev: Controlling GDB,  Up: Top
  1082.  
  1083. Canned Sequences of Commands
  1084. ****************************
  1085.  
  1086.    Aside from breakpoint commands (*note Break Commands::.), GDB
  1087. provides two ways to store sequences of commands for execution as a
  1088. unit:
  1089. user-defined commands and command files.
  1090.  
  1091. * Menu:
  1092.  
  1093. * Define::            User-Defined Commands
  1094. * Command Files::        Command Files
  1095. * Output::            Commands for Controlled Output
  1096.  
  1097. 
  1098. File: gdb.info,  Node: Define,  Next: Command Files,  Prev: Sequences,  Up: Sequences
  1099.  
  1100. User-Defined Commands
  1101. =====================
  1102.  
  1103.    A "user-defined command" is a sequence of GDB commands to which
  1104. you assign a new name as a command.  This is done with the `define'
  1105. command.
  1106.  
  1107. `define COMMANDNAME'
  1108.      Define a command named COMMANDNAME.  If there is already a
  1109.      command by that name, you are asked to confirm that you want to
  1110.      redefine it.
  1111.  
  1112.      The definition of the command is made up of other GDB command
  1113.      lines, which are given following the `define' command.  The end
  1114.      of these commands is marked by a line containing `end'.
  1115.  
  1116. `document COMMANDNAME'
  1117.      Give documentation to the user-defined command COMMANDNAME.  The
  1118.      command COMMANDNAME must already be defined.  This command
  1119.      reads lines of documentation just as `define' reads the lines
  1120.      of the command definition, ending with `end'.  After the
  1121.      `document' command is finished, `help' on command COMMANDNAME
  1122.      will print the documentation you have specified.
  1123.  
  1124.      You may use the `document' command again to change the
  1125.      documentation of a command.  Redefining the command with
  1126.      `define' does not change the documentation.
  1127.  
  1128. `help user-defined'
  1129.      List all user-defined commands, with the first line of the
  1130.      documentation (if any) for each.
  1131.  
  1132. `info user'
  1133. `info user COMMANDNAME'
  1134.      Display the GDB commands used to define COMMANDNAME (but not its
  1135.      documentation).  If no COMMANDNAME is given, display the
  1136.      definitions for all user-defined commands.
  1137.  
  1138.    User-defined commands do not take arguments.  When they are
  1139. executed, the commands of the definition are not printed.  An error
  1140. in any command stops execution of the user-defined command.
  1141.  
  1142.    Commands that would ask for confirmation if used interactively
  1143. proceed without asking when used inside a user-defined command. 
  1144. Many GDB commands that normally print messages to say what they are
  1145. doing omit the messages when used in a user-defined command.
  1146.  
  1147. 
  1148. File: gdb.info,  Node: Command Files,  Next: Output,  Prev: Define,  Up: Sequences
  1149.  
  1150. Command Files
  1151. =============
  1152.  
  1153.    A command file for GDB is a file of lines that are GDB commands. 
  1154. Comments (lines starting with `#') may also be included.  An empty
  1155. line in a command file does nothing; it does not mean to repeat the
  1156. last command, as it would from the terminal.
  1157.  
  1158.    When you start GDB, it automatically executes commands from its
  1159. "init files".  These are files named `.gdbinit'.  GDB reads the init
  1160. file (if any) in your home directory and then the init file (if any)
  1161. in the current working directory.  (The init files are not executed
  1162. if you use the `-nx' option; *note Mode Options::..)  You can also
  1163. request the execution of a command file with the `source' command:
  1164.  
  1165. `source FILENAME'
  1166.      Execute the command file FILENAME.
  1167.  
  1168.    The lines in a command file are executed sequentially.  They are
  1169. not printed as they are executed.  An error in any command
  1170. terminates execution of the command file.
  1171.  
  1172.    Commands that would ask for confirmation if used interactively
  1173. proceed without asking when used in a command file.  Many GDB
  1174. commands that normally print messages to say what they are doing
  1175. omit the messages when called from command files.
  1176.  
  1177. 
  1178. File: gdb.info,  Node: Output,  Prev: Command Files,  Up: Sequences
  1179.  
  1180. Commands for Controlled Output
  1181. ==============================
  1182.  
  1183.    During the execution of a command file or a user-defined command,
  1184. normal GDB output is suppressed; the only output that appears is
  1185. what is explicitly printed by the commands in the definition.  This
  1186. section describes three commands useful for generating exactly the
  1187. output
  1188. you want.
  1189.  
  1190. `echo TEXT'
  1191.      Print TEXT.  Nonprinting characters can be included in TEXT
  1192.      using C escape sequences, such as `\n' to print a newline.  No
  1193.      newline will be printed unless you specify one. In addition to
  1194.      the standard C escape sequences, a backslash followed by a
  1195.      space stands for a space.  This is useful for outputting a
  1196.      string with spaces at the beginning or the end, since leading
  1197.      and trailing spaces are otherwise trimmed from all arguments. 
  1198.      Thus, to print ` and foo = ', use the command `echo \ and foo =
  1199.      \ '.
  1200.  
  1201.      A backslash at the end of TEXT can be used, as in C, to continue
  1202.      the command onto subsequent lines.  For example,
  1203.  
  1204.           echo This is some text\n\
  1205.           which is continued\n\
  1206.           onto several lines.\n
  1207.  
  1208.      produces the same output as
  1209.  
  1210.           echo This is some text\n
  1211.           echo which is continued\n
  1212.           echo onto several lines.\n
  1213.  
  1214. `output EXPRESSION'
  1215.      Print the value of EXPRESSION and nothing but that value: no
  1216.      newlines, no `$NN = '.  The value is not entered in the value
  1217.      history either.  *Note Expressions:: for more information on
  1218.      expressions.
  1219.  
  1220. `output/FMT EXPRESSION'
  1221.      Print the value of EXPRESSION in format FMT.  You can use the
  1222.      same formats as for `print'; *note Output formats::., for more
  1223.      information.
  1224.  
  1225. `printf STRING, EXPRESSIONS...'
  1226.      Print the values of the EXPRESSIONS under the control of STRING.
  1227.      The EXPRESSIONS are separated by commas and may be either
  1228.      numbers or pointers.  Their values are printed as specified by
  1229.      STRING, exactly as if the program were to execute
  1230.  
  1231.           printf (STRING, EXPRESSIONS...);
  1232.  
  1233.      For example, you can print two values in hex like this:
  1234.  
  1235.           printf "foo, bar-foo = 0x%x, 0x%x\n", foo, bar-foo
  1236.  
  1237.      The only backslash-escape sequences that you can use in the
  1238.      format string are the simple ones that consist of backslash
  1239.      followed by a letter.
  1240.  
  1241.